{include file="public/header" /}

<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
            <fieldset
              id="searchFieldset_currentTableRenderId"
              class="table-search-fieldset"
            >
              <legend>条件搜索</legend>
              <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">分类名称</label>
                  <div class="layui-input-inline">
                    <input
                      type="text"
                      name="name"
                      placeholder="请输入分类名称"
                      value="{:input('get.name')}"
                      autocomplete="off"
                      class="layui-input"
                    />
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <button
                    class="layui-btn layui-btn-normal"
                    lay-submit=""
                    lay-filter="sreach"
                  >
                    搜索
                  </button>
                </div>
              </form>
            </fieldset>
          </div>
          <div class="layui-card-body layui-row layui-col-space10">
            <button
              class="layui-btn layui-bg-cyan layui-btn-sm"
              onclick="open_add('添加分类','platclass_edit')"
            >
              添加分类名称
            </button>
            共有数据：<strong id="count">{$list->total()}</strong> 条
          </div>
          <div class="layui-table-body layui-table-main">
            <table class="layui-table">
              <thead>
                <tr>
                  <th>
                    <div class="layui-table-cell">ID</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">名称</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">排序[越大越靠前]</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">图标</div>
                  </th>

                  <th>
                    <div class="layui-table-cell">操作</div>
                  </th>
                </tr>
              </thead>
              <tbody>
                {foreach $list as $v}
                <tr>
                  <td>
                    <div class="layui-table-cell">{$v.id}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.name}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.sort}</div>
                  </td>
                  <td>
                    <div id="layer-photos-demo" class="layer-photos-demo">
                      <img
                        layer-pid=""
                        style="height: 40px"
                        layer-src="{$v.images}"
                        src="{$v.images}"
                        alt="{$v.name}"
                      />
                    </div>
                  </td>
                  <td class="layui-table-col-special">
                    <div class="layui-table-cell">
                      <a
                        title="编辑"
                        onclick="open_add('编辑','/system/platclass_edit?id={$v.id}')"
                        href="javascript:;"
                        class="layui-btn layui-btn-sm"
                      >
                        编辑
                      </a>
                      {if $v.isshow == 1}
                      <a
                        title="隐藏"
                        onclick="open_dels(this,'/system/platclass_del','{$v.id}')"
                        href="javascript:;"
                        class="layui-btn-danger layui-btn layui-btn-sm"
                      >
                        隐藏
                      </a>
                      {else}
                      <a
                        title="隐藏"
                        onclick="open_dels(this,'/system/platclass_del','{$v.id}')"
                        href="javascript:;"
                        class="layui-btn-normal layui-btn layui-btn-sm"
                      >
                        显示 </a
                      >{/if}
                    </div>
                  </td>
                </tr>
                {/foreach}
              </tbody>
            </table>
          </div>
          <div class="layui-card-body">
            <div class="page">{$list->render()|raw}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  {include file="public/footer"}
  <script>
    layui.use(["form", "layer"], function () {
      $ = layui.jquery;
      var form = layui.form,
        layer = layui.layer;
    });
  </script>
</body>
